package com.neusoft.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.po.Business;
import com.neusoft.po.CommonResult;
import com.neusoft.service.BusinessService;

@RefreshScope
@RestController
@RequestMapping("/BusinessController")
public class BusinessController {
	
	@Autowired
	private BusinessService businessSerivce;
	
	@RequestMapping("/listBusinessByOrderTypeId/{orderTypeId}")
	public CommonResult<List<Business>> listBusinessByOrderId(@PathVariable("orderTypeId") int orderTypeId){
		return new CommonResult<List<Business>>(200,"success",businessSerivce.listBusinessByOrderTypeId(orderTypeId));
	}
	
//	@RequestMapping("/testh300579")
//	public Business testh300579(int businessId){
//		return businessSerivce.testh300579(businessId);
//	}
	
	@GetMapping("/getBusinessById/{businessId}")
	public CommonResult<Business> getBusinessById(@PathVariable("businessId") int businessId){
		return new CommonResult<Business>(200,"success", businessSerivce.getBusinessById(businessId));
	}
	
	
}
